package com.example.mybatisplus.Pojo;

import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum ResultCode {
    SUCCESS(2000,"操作成功"),
    INSERT_SUCCESS(2010,"增加数据成功"),
    DELETE_SUCCESS(2020,"删除数据成功"),
    UPDATE_SUCCESS(2030,"修改数据成功"),
    SELECT_SUCCESS(2040,"查询数据成功"),


    FAILURE(3000,"操作失败"),
    INSERT_FAILURE(3010,"增加数据失败"),
    INSERT_FAILURE_INDEX_UNIQUE_USERNAME(3011,"增加数据失败,用户名username唯一"),
    DELETE_FAILURE(3020,"删除数据失败"),
    DELETE_FAILURE_DATA_NOT_EXIST(3021,"数据不存在,删除数据失败"),
    UPDATE_FAILURE(3030,"修改数据失败"),
    SELECT_FAILURE(3040,"查询数据失败，返回NULL"),
    ;

    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
